function clock() {
var digital = new Date();

//DATE
var month=new Array(12);
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";
var month_num = digital.getMonth();
var day = digital.getDate();
var year = digital.getFullYear();

var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;

//TIME ONLY
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;

//DATE AND TIME
dispTime = month[month_num]+" "+day+", "+year+"  "+hours + ":" + minutes + ":" + seconds + " " + amOrPm;

document.getElementById('div_datetime').innerHTML = dispTime;
setTimeout("clock()", 1000);
}
window.onload=clock;